package com.tbq.rebootapk;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.os.Handler;

public class AlarmReceiver extends BroadcastReceiver {

//	@Override
//	public void onReceive(Context context, Intent intent) {
//		Intent i = new Intent(context, CheckAppRunService.class);
//		context.startService(i);
//	}

	private final String ACTION = "android.intent.action.BOOT_COMPLETED";

	@Override
	public void onReceive(final Context context, Intent intent) {
		// TODO Auto-generated method stub

		if (intent.getAction().equals(ACTION))
		{
			new Handler().postDelayed(new Runnable() {
				public void run() {
					Intent i = new Intent(context, CheckAppRunService.class);
					context.startService(i);
				}
			}, 10 * 1000);

		}else
		{
			Intent i = new Intent(context, CheckAppRunService.class);
			context.startService(i);
		}

	}

}
